package com.yinhai.ta404.core.validate.annotation;

import com.yinhai.ta404.core.validate.validator.PatternValidator;
import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;

@Constraint(
        validatedBy = {PatternValidator.class}
)
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Repeatable(VGroup.class)
public @interface V {
    String message() default "{message}";

    String[] value() default {};

    Class<?>[] groups() default {};

    Class<?> type() default Object.class;

    Class<? extends Payload>[] payload() default {};
}
